package cn.stylefeng.guns.modular.business.frequency.transportsign.enums;

/**
 * 运输结算人
 */
public enum TransportLevelDeliveryTypeEnum {

    SITE(1, "网点"),
    CUSTOMER(2, "客户"),
    NEAR_SITE(3, "网点附近"),
    NO_SITE_TRANSFER(4, "无网点中转");

    TransportLevelDeliveryTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int type;

    public String desc;

    public static boolean valid(Integer type) {
        if (type == null) {
            return false;
        }
        TransportLevelDeliveryTypeEnum[] pts = TransportLevelDeliveryTypeEnum.values();
        for (TransportLevelDeliveryTypeEnum pt : pts) {
            if (type == pt.type) {
                return true;
            }
        }
        return false;
    }

    public static String getValue(Integer type) {
        if (type == null) {
            return "";
        }
        TransportLevelDeliveryTypeEnum[] pts = TransportLevelDeliveryTypeEnum.values();
        for (TransportLevelDeliveryTypeEnum pt : pts) {
            if (type == pt.type) {
                return pt.desc;
            }
        }
        return "";
    }
}
